#include<stdio.h>
#include<string.h>
int str(char p[1000])
{
	int i=0,a=0,b=0,c=0,d=0;
	while(p[i]!='\0')
	{
		if(p[i]>='a'&&p[i]<='z'||p[i]>='A'&&p[i]<='Z')
		{
			(a)++;
		}
		else if(p[i]>='0'&&p[i]<='9')
		{
			(b)++;
		}
		else if(p[i]==' ')
		{
			(c)++;
		}
		else
		{
			(d)++;
		}
		i++;
	}
	printf("%d %d %d %d",a,b,c,d);
	return 0;	
}
int main()
{
	char p[1000];
	gets(p);
	str(p);
}
